Skip to content

Add workspace root kep - #10

Open
mjudeikis wants to merge 3 commits into
mainfrom
workspaceRoot.kep
Open

Add workspace root kep#10
mjudeikis wants to merge 3 commits into
mainfrom
workspaceRoot.kep

Conversation

@mjudeikis

Copy link
Copy Markdown
Contributor

No description provided.

@kcp-ci-bot kcp-ci-bot added dco-signoff: yes Indicates the PR's author has signed the DCO. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 9, 2026
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
Comment thread keps/core/0003-workspace-root.md Outdated
@ntnn

ntnn commented Feb 12, 2026

Copy link
Copy Markdown
Member

After talking some more @mjudeikis and I both are not budging from our positions. Instead we are going to make two feature gates.
The feature gate that enables the feature at all but with randomly named root and the second feature gate that then sets the root based on the name of the object - with all implications that can come with.

This still allows kcp instances in which users can create their own roots with a random name as well as instances where platform owners can decide legible names.

The only drawback of this is that these two system can then not be mixed. But all other options that come to mind (two types, two APIs, ...) do not sit well.

@mjudeikis

Copy link
Copy Markdown
Contributor Author

The only drawback of this is that these two system can then not be mixed. But all other options that come to mind (two types, two APIs, ...) do not sit well.

They can be mixed. There is nothing in there that would make it them not mix. One can use one mode, and switch to another midd operations and have both. Is it nice? No :D

@ntnn

ntnn commented Feb 17, 2026

Copy link
Copy Markdown
Member

They can be mixed. There is nothing in there that would make it them not mix. One can use one mode, and switch to another midd operations and have both. Is it nice? No :D

Technically speaking yes, practically speaking that is horrifying. :D

@mjudeikis mjudeikis added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 17, 2026
Comment on lines +75 to +78
// Cluster is an optional name for the logical cluster path.
// If not provided, a random base36 identifier will be generated.
// +optional
Cluster string `json:"cluster,omitempty"`

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Cluster is an optional name for the logical cluster path.
// If not provided, a random base36 identifier will be generated.
// +optional
Cluster string `json:"cluster,omitempty"`
// ClusterName is an optional name for the logical cluster path.
// If not provided, a random base36 identifier will be generated.
// +optional
ClusterName string `json:"clusterName,omitempty"`

Since we call it clusterName everywhere else - or is there precedent for just cluster in the logical cluster?

// URL is the base URL for accessing workspaces in this tree via the front-proxy.
// Format: https://<front-proxy>/clusters/<rootPath>
// This is set by the provisioning controller based on the front-proxy configuration.
// Note: All front-proxies in a kcp deployment must share the same external URL.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Note: All front-proxies in a kcp deployment must share the same external URL.

I think this is something that should be set in stone in kcp-dev/kcp#3837 rather than in an otherwise mostly unrelated part.

Comment on lines +239 to +265
#### Feature Gate: `LogicalRootRandomNames` (default: enabled)

When enabled, the root path identifier is always randomly generated (base36), regardless of
the `metadata.name` of the LogicalRoot object. This prevents:
- Different shards from claiming the same prefix
- Predictable/guessable root identifiers
- Collisions when multiple controllers provision roots concurrently

Example:
```yaml
apiVersion: forest.tenancy.kcp.io/v1alpha1
kind: LogicalRoot
metadata:
name: company-a # Object name for management
spec:
cluster: "" # Empty = randomly generated. Not allowed to specify when random names enabled.
status:
rootPath: a1b2c3d4 # Randomly generated, used for access
```

#### Feature Gate: `LogicalRootDeterministicNames` (default: disabled)

When enabled (and `LogicalRootRandomNames` disabled), the root path is derived from
`metadata.name`. This is useful for deployments where:
- Predictable paths are required for automation
- A single controller manages all root provisioning
- Human-readable paths are preferred over security-by-obscurity

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a fan of two possibly conflicting feature gates. Sure we can put a check in code but I don't really like that behaviour.

If we enable the forest API by default random names should just be on and a feature gate should allow users to set spec.cluster. LogicalRootAllowCustomNames?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Following that if spec.cluster is empty kcp generates a name.

Comment on lines +270 to +276
#### Other Naming Considerations

- **Cluster**: The `spec.cluster` field specifies the desired logical cluster path. If empty,
a random base36 identifier is generated (when `LogicalRootRandomNames` is enabled).
- **Root workspace**: The system `root` workspace continues to exist for system resources.
Organizations get their own independent trees.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
#### Other Naming Considerations
- **Cluster**: The `spec.cluster` field specifies the desired logical cluster path. If empty,
a random base36 identifier is generated (when `LogicalRootRandomNames` is enabled).
- **Root workspace**: The system `root` workspace continues to exist for system resources.
Organizations get their own independent trees.

The first point is already discussed above, the second point is irrelevant imho

### Alternative 1: Modify Workspace API with `--root` flag

```bash
kubectl ws create bar --enter --root

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
kubectl ws create bar --enter --root
kubect create-workspace bar --enter --root

ws create is deprecated

@xrstf

xrstf commented Feb 18, 2026

Copy link
Copy Markdown

/approve

@kcp-ci-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: xrstf

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@kcp-ci-bot kcp-ci-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. dco-signoff: yes Indicates the PR's author has signed the DCO. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants